home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Sample Code / AppsToGo / CalcIt / CalcIt.make < prev    next >
Encoding:
Text File  |  1994-03-24  |  6.7 KB  |  158 lines  |  [TEXT/MPS ]

  1. #------------------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    Program:    CalcIt
  6. #    File:        CalcIt.make    -    Make Source
  7. #
  8. #    Copyright © 1988-1992 Apple Computer, Inc.
  9. #    All rights reserved.
  10. #
  11. #------------------------------------------------------------------------------
  12.  
  13. AppName            =    'CalcIt'
  14. Signature        =    'CCIT'
  15.  
  16. DTS.Lib.folder    =    "::DTS.Lib:"
  17. DTS.Lib.hdrs    =    "::DTS.Lib:DTS.Lib.headers:"
  18. projsrc            =    :
  19. obj                =     :OBJECT:
  20.  
  21. #------------------------------------------------------------------------------
  22. # Options for our compilers:
  23. #    -sym on: tells the compilers and linker to emit symbol information for
  24. #        a source level debugger, such as SADE.
  25. #    -i {DTS.Lib.hdrs}: means to look for any #include files in the specified
  26. #        directory, as well as the normal set.
  27. #    -r: tells the C compiler to require function prototypes.
  28. #    -mbg off: tells the compilers to not emit low-level debugger names. This
  29. #        saves on file space, but you may wish to remove this option if you
  30. #        need to debug with something like Macsbug.
  31. #    -rd: for Rez means to suppress warnings for redeclared types (we redeclare
  32. #        'RECT' because it’s not included in MPW 3.0).
  33. #    -append: means to add the resources to the target file, rather than
  34. #        deleting all the ones that are there first.
  35. #    -d Signature...: is a way of passing our application's signature to Rez.
  36. #        With this mechanism, we can define our signature here, and export
  37. #        it to Rez, so that we don't have to declare it there, too.
  38. #    -sn STDCLIB=Main: puts all the routines that would normally go into the
  39. #        STDCLIB segment into the Main segment. This is done so that when we
  40. #        call upon any low-level utilities, we don't potentially move memory
  41. #        by loading in a segment.
  42. #------------------------------------------------------------------------------
  43.  
  44. SymOptions        =    #-sym on                    # turn this on to debug with SADE
  45. IncludesFolders    =    -i {DTS.Lib.hdrs}
  46.  
  47. COptions        =    {IncludesFolders} {SymOptions} -r -mbg on
  48. RezOptions        =    {IncludesFolders} -rd -append -d Signature="{Signature}" -d AppName={AppName}
  49. LinkOptions        =    {SymOptions} {SegmentMappings} -msg nodup -w
  50. SegmentMappings    =    -sn INTENV=Main ∂
  51.                     -sn STDCLIB=Main ∂
  52.                     -sn SANELIB=Main ∂
  53.                     -sn StringUtils=Main ∂
  54.                     -sn UtilMain=Main
  55.  
  56. #------------------------------------------------------------------------------
  57. # These are modified default build rules.  This is necessary to take into
  58. # account differences between MPW 3.1 and 3.2
  59. #------------------------------------------------------------------------------
  60. {obj}            ƒ    {projsrc}
  61.  
  62. {obj}.p.o        ƒ    {projsrc}.p
  63.     {Pascal} {POptions} {PAltOptions} {DepDir}{Default}.p -o {TargDir}{Default}.p.o
  64.  
  65. {obj}.c.o        ƒ    {projsrc}.c
  66.     {C} {COptions} {CAltOptions} {DepDir}{Default}.c -o {TargDir}{Default}.c.o
  67.  
  68. #------------------------------------------------------------------------------
  69. # These are the objects that we want to link with. If any one of these
  70. # changes, then we invoke the Link command.
  71. #------------------------------------------------------------------------------
  72. AppObjects        =    ∂
  73.                     {obj}DoEvent.c.o ∂
  74.                     {obj}EventLoop.c.o ∂
  75.                     {obj}File.c.o ∂
  76.                     {obj}Help.c.o ∂
  77.                     {obj}IdleTasks.c.o ∂
  78.                     {obj}Menu.c.o ∂
  79.                     {obj}Start.c.o ∂
  80.                     {obj}TRootObj.c.o ∂
  81.                     {obj}Window.c.o ∂
  82.                     {obj}WindowDialog.c.o ∂
  83.                     {obj}WindowPalette.c.o
  84.  
  85. CSysObjects = ∂
  86.     {DTS.Lib.folder}DTS.Lib_controls ∂
  87.     {DTS.Lib.folder}DTS.Lib_ctlhandler ∂
  88.     {DTS.Lib.folder}DTS.Lib_framework ∂
  89.     {DTS.Lib.folder}DTS.Lib_strings ∂
  90.     {DTS.Lib.folder}DTS.Lib_treeobj ∂
  91.     {DTS.Lib.folder}DTS.Lib_utils ∂
  92.     "{Libraries}Runtime.o" ∂
  93.     "{CLibraries}StdCLib.o" ∂
  94.     "{Libraries}Interface.o"
  95.  
  96. #------------------------------------------------------------------------------
  97. # Dependencies for the individual components. These will invoke the
  98. # default build rules listed in Chapter 9 of the MPW 3.0 manual.
  99. # You may wish to reduce the number of dependencies.  Two dependencies
  100. # you may wish to remove are this makefile and the App.protos.h file.
  101. # For the App.protos.h file, if you add a function to the list of
  102. # functions in App.protos.h, you will cause all the source files to be
  103. # recompiled.  This may be more than you want to wait for each time you
  104. # add a function to your application.  On the other hand, if you do not
  105. # include this in the dependencies, and you change the parameters for a
  106. # function, and make the respective change to App.protos.h, any files
  107. # that reference that function will not be recompiled.  If these files are
  108. # recompiled, the prototype checking will catch any cases where you did
  109. # not change the way the altered function was called.  <<You choose>>
  110. #------------------------------------------------------------------------------
  111.  
  112. {AppObjects}    ƒ    #{AppName}.make ∂
  113. #                    App.h ∂
  114. #                    App.protos.h ∂
  115.                     App.Common.h
  116.  
  117. #------------------------------------------------------------------------------
  118. # This is a dummy dependency rule.  This will always be executed.  This dummy
  119. # rule must be the first for {AppName} so that it will be executed first.
  120. # This is necessary to make evaluations that are beyond the scope of
  121. # Make.  These evaluations will be performed by the application at execution time,
  122. # and they must execute first because compile and link command lines depend
  123. # on variables set up by these evaluations.  This has the unfortunate side
  124. # effect that Make will always consider {AppName} to be out of date.  It will
  125. # always, at a minimum, execute the commands for the target ShellForce.
  126. #------------------------------------------------------------------------------
  127.  
  128. {AppName}            ƒƒ ShellForce
  129.  
  130. # With the above rule, {AppName} will always be out of date with respect to
  131. # the non-existent file ShellForce.  This will force the following commands to
  132. # be executed.
  133. ShellForce            ƒ
  134.     BEGIN
  135.         IF "{ShellVersion}" == ""
  136.             ( EVALUATE "`Version`" =~ /MPW Shell≈ ([0-9]+(.[ab0-9]+)+)®1≈/ ) ∑ Dev:Null
  137.             SET ShellVersion "{®1}"
  138.         END
  139.     END ∑ Dev:Null # Output to bit bucket so we don’t see above calculations
  140.  
  141. #------------------------------------------------------------------------------
  142. # Build rule that links our application together. If any of our objects 
  143. # changes, or this makefile changes, then we relink.  The dummy prerequisite
  144. # ShellForce must come before any other prerequisites for {AppName}
  145. #------------------------------------------------------------------------------
  146.  
  147. {AppName}            ƒƒ {AppObjects}
  148.     Link {LinkOptions} -o {Targ} {AppObjects} {CSysObjects}
  149.     SetFile {Targ} -t APPL -c {Signature} -a B
  150.  
  151. #------------------------------------------------------------------------------
  152. # Build rule that creates our resources and adds them to the application
  153. #------------------------------------------------------------------------------
  154.  
  155. {AppName}        ƒƒ    {AppName}.make ∂
  156.                     {AppName}.r
  157.     Rez {RezOptions} {AppName}.r -o {Targ}
  158.